package com.shangxia.order.controller;

import com.shangxia.common.vo.ResultVO;
import com.shangxia.feign.model.SX_Order;
import com.shangxia.order.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhouya38158
 * @Package com.example.user.controller
 * @date 2021/11/2 14:46
 */
@Slf4j
@RestController
@RequestMapping("/order")
@Api("order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/{id}")
    @ApiOperation(value = "order", notes = "order")
    public SX_Order queryById(@ApiParam("id") @PathVariable("id") Long id) {
        return orderService.queryById(id);
    }

    @GetMapping("/list")
    @ApiOperation(value = "order", notes = "order")
    public ResultVO<List<SX_Order>> listSxOrder() {
        return ResultVO.okResultVO(orderService.listSxOrder());
    }

}
